package com.example.ykbboom.universitytransportation.Activity;

import android.app.Activity;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ykbboom
 * @email ykbpro@whut.edu.cn
 * @time 2017-1-22 17:21:17
 * 功能: 管理所有活动
 */
public class ActivityManager {
    public static List<Activity>activities = new ArrayList<Activity>();

    public static void addActivity(Activity activity){
        activities.add(activity);
    }
    public static void removeActivity(Activity activity){
        activities.remove(activity);
    }
    public static void finishAll(){
        for(Activity activity:activities){
            if (!activity.isFinishing()){
                activity.finish();
            }
        }
    }
}